package com.liqi.info.service.impl;

import java.util.List;
import com.liqi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.liqi.info.mapper.TInfoPublicityMapper;
import com.liqi.info.domain.TInfoPublicity;
import com.liqi.info.service.ITInfoPublicityService;

/**
 * 公示Service业务层处理
 * 
 * @author xiaoli
 * @date 2022-11-19
 */
@Service
public class TInfoPublicityServiceImpl implements ITInfoPublicityService 
{
    @Autowired
    private TInfoPublicityMapper tInfoPublicityMapper;

    /**
     * 查询公示
     * 
     * @param id 公示主键
     * @return 公示
     */
    @Override
    public TInfoPublicity selectTInfoPublicityById(Long id)
    {
        return tInfoPublicityMapper.selectTInfoPublicityById(id);
    }

    /**
     * 查询公示列表
     * 
     * @param tInfoPublicity 公示
     * @return 公示
     */
    @Override
    public List<TInfoPublicity> selectTInfoPublicityList(TInfoPublicity tInfoPublicity)
    {
        return tInfoPublicityMapper.selectTInfoPublicityList(tInfoPublicity);
    }

    /**
     * 新增公示
     * 
     * @param tInfoPublicity 公示
     * @return 结果
     */
    @Override
    public int insertTInfoPublicity(TInfoPublicity tInfoPublicity)
    {
        tInfoPublicity.setCreateTime(DateUtils.getNowDate());
        tInfoPublicity.setUpdateTime(DateUtils.getNowDate());
        tInfoPublicity.setStatus(0);
        return tInfoPublicityMapper.insertTInfoPublicity(tInfoPublicity);
    }

    /**
     * 修改公示
     * 
     * @param tInfoPublicity 公示
     * @return 结果
     */
    @Override
    public int updateTInfoPublicity(TInfoPublicity tInfoPublicity)
    {
        tInfoPublicity.setUpdateTime(DateUtils.getNowDate());
        return tInfoPublicityMapper.updateTInfoPublicity(tInfoPublicity);
    }

    /**
     * 批量删除公示
     * 
     * @param ids 需要删除的公示主键
     * @return 结果
     */
    @Override
    public int deleteTInfoPublicityByIds(Long[] ids)
    {
        return tInfoPublicityMapper.deleteTInfoPublicityByIds(ids);
    }

    /**
     * 删除公示信息
     * 
     * @param id 公示主键
     * @return 结果
     */
    @Override
    public int deleteTInfoPublicityById(Long id)
    {
        return tInfoPublicityMapper.deleteTInfoPublicityById(id);
    }
}
